<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-02-24 20:09:49
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-05-11 17:07:17
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\rebate-setting.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<page-header-wrapper [title]="''"> </page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <!-- 查询字段小于或等于3个时，不显示伸缩按钮 -->
      <sf
        #sf
        [schema]="schema"
        [ui]="ui"
        [mode]="'search'"
        [disabled]="!sf?.valid"
        [loading]="service.http.loading"
        [button]="'none'"
      ></sf>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
      <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1);">查询</button>
      <!-- <button nz-button nzType="primary" [disabled]="service.http.loading"  acl  [acl-ability]="['REBATE-SETTING-export']">导出</button> -->
      <button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button>
    </div>
  </div>
</nz-card>

<nz-card>
  <!-- 数据列表 -->
  <!-- +新增 -->
  <div class="d-flex justify-content-end mb-sm">
    <div>
        <button nz-button nzType="primary" (click)="configAction()"  acl  [acl-ability]="['REBATE-SETTING-add']">新增</button>
    </div>
</div>
  <st
    #st
    [data]="service.$api_get_rebateConfig"
    [columns]="columns"
    [scroll]="{x: '1200px'}"
    [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
    [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
    [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
    [loadingDelay]="500"
    [loading]="service.http.loading"
  >
  <ng-template st-row='configType' let-item let-index='index'>
    <div *ngIf="item.configType == 1">按全部等级配置</div>
    <div *ngIf="item.configType == 2">按不同等级配置</div>
  </ng-template>
  <ng-template st-row='partnerType' let-item let-index='index'>
    <div *ngIf="item.partnerType == 1">全部合伙人</div>
    <div *ngIf="item.partnerType == 2">新注册合伙人</div>
    <div *ngIf="item.partnerType == 3">自定义合伙人</div>
  </ng-template>
  <ng-template st-row='stateLocked' let-item let-index='index'>
    <div >{{item?.stateLocked ? '失效' : '生效中'}}</div>
  </ng-template>
  </st>
</nz-card>
